#ifndef PAGE_H
#define PAGE_H

#include <string>
#include <iostream>
#include <list>
#include <string>
#include <fstream>
#include <stack>
#include <curl/curl.h>

using namespace std;

#include "pageTracker.h"

class PageTracker;

class Page
{
public:
	Page(string url, unsigned long long level);

	friend class PageTracker;

private:

	// a linked list pointing to each page that this page references
	// :TODO: figure out a way to return it as a get function,
	// w/o getting compiler errors
	list<string> urlsReferenced_;

	// downloads from the url_, into the specified filename 
	void downloadSelf(string baseUrl, string filename);

	// parses the specified filename for the urls of other pages,
	// and stores them in urlsReferenced_
	void parseAndRecordUrls(string filename);

	// the "level" of the page (the "root" page is considered to be level 1)
	unsigned long long level_;

	// relative url of the article (something like "/wiki/...")
	string url_;

	// title of article (found by parsing the temporarily downloaded file)
	string title_;
};

#endif
